/* This package wraps the JSON ElasticSearch API to provide advanced search capabilities on top of lucene.

In order to use this package you MUST HAVE a working elastic search installation, for more details on
how to install elasticSearch see http://www.elasticsearch.org/.

First thing you msut open a connection to the elastic server, by calling,

    conn := es.NewConn("http://localhost:9200")

After that, you must create a bind to a index/type to start using.

    index := conn.Open("agenda","persons")

Then you can use your index variable to put/get information from the ElasticSearch index.

Every document MUST HAVE a unique id, if you don't pass an Id one will be created from the current time / random number.
You can change that by calling 

    index.IndexGen(func(object interface{}) (string) { return "my-unique-id-generator" })

See the documentation on the IndexGen function for more information.

Then after that you can push JSON documents into the index by calling

    err := index.Write(id string, doc interface{})
    if err == nil {
        // document inserted
    } else {
        // unable to insert document
        panic(err)
    }

If the doc parameter is a string the library will consider it a valid json object and will try to index without any processing,
if you pass anything other than a string json.Marshal will be called on that object.

To search for some object you must call

    hits, err := index.Read("name","Andr*")
    // or make a ranged query
    hits, err := index.Range("name", 0, 10)

The hits variable will have a array of all the objects found by the query, this array could be empty. The err variable will be nil
only if the server responde with an HTTP error code.

*/
package es
